clean up prints and fix len problem