Improved code
Merge pull request #260 from fabienrohrer/master

Improved code