pause button added
refactoring