added space at end of printf, cout << endl after loop