changed formatting and print statement locations