Bug fixing and adding test cases, pending implementation