added diameter and level with maxsum fun