Doing some refactoring and fixing issue #10 and fixing issue #10
Fixing issue #11