getting rid of printf in spin loop