printf in the right place