remove commented code. add pause feature and some minor fixes