input output of functions
correct some errors and typos