cleaned up some functions, removed unnecessary comments