Updated code and added test cases