need to mind the recursion depth, continued work on painted