change print to function in 4 files