fixed loop printing