Reverted back to initial code from CM