Removed code not in use. Added more comments