The one comment I have on this is I think it would be good to keep the braces on the if statement, especially with the two returns in the function.