refined curlyCountLeveled() method