Step-2: Done a little bit to make the test pass.
Step-3: Refactored the code. Readability improved?