cleanup

removed some unused functions and added more comments