debug min and max