using printf instead of println