It would help if your code was properly formatted with indentation.
Also, can you please be more specific that just "not working"? Does it compile? does it run? Does it crash? Does it play "Happy" by Pharrel Williams, when you want it to play "Fireworks" by Katy Perry?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors