put code into function, added selection for music
added more functions