Recursive Implementation

Added a recursive implementation for testing purposes.