Added comments and Code cleanup