test cases added and library modified