Refactor code to make it more flexible and easier to understand.
Initial recursive solution - not really working.
Fix the recursive list reversal implementation.