Refactored 36.
Added test case to 37.