Added functions to do all the work for the user