Level_max variable added