Added user functions to clean up code