changing certain functions to be methods to cut down on code complexity