changed input arguments to functions in main