Improved comments. Please add test cases.