created separate print functions from the main function and other functions.