applied pause/play feature and fixed other bugs