Optimized codes and checked the compatiblity issues.