Fixing test cases; Adding more functionality