changed the structure of the function that you need to pass in
added an error checking for process_loop, added comments for the class
methods