Converted print statements to print function