Use printf instead of echo as \n is being printed currently