Fixed functional requirements and added some test cases.