complete code re-write
Merge pull request #2 from nadavmatalon/reWrite

complete code re-write