Amir - correcting the logic and adding more tests
Amir - adding missing modules