refactored code
Merge pull request #2 from camilolopes/master

refactored code