Implement recursion (untested, due to a bug in proteus)