Fixed some compile errors and changed the names of functions to make them more ruby esque