Code clean up and Comments added