Updated test cases and added comments.