Elaborated solution
Merge pull request #709 from abhinavc/master

Elaborated solution