adding min_level and tests