suppressed prints and corrected bug in 'main'