Ready for pull - TODO: fix RuntimeError: maximum recursion depth exceeded