Code clean up

unused code and comments deleted && credit given in head of the files