Corrected
Merge pull request #826 from abhinavc/master

Corrected solution