Starting recursive mapping code