Edited logic of all operation codes and added validation