remove stray puts and do fewer cycles