Got rid off all the test code, and lists. Also changed the names of the functions 

Changed names of some functions to prevent name overlapping.