maximum x calculation on y-level