added pause feature/code cleanup