Refactored 28 and added test cases.