convert all print statments to functions