Refacotred to make the code easier to read, fixed the 'does't run' bug
Merge pull request #1 from CarlFK/master

Refacotred to make the code easier to read, fixed the 'does't run' bug