- changes based on review comments. Added some new test cases