By my previous comment, I just meant fixing up the spacing/newlines. What you had before was fine, it's just that the braces should be on the same line.