implement depth limit for the flame transformations