fixing and adding test cases