Made the solution more elegant 

:) Agreed, much more elegant.