updated functions and added user input file