removed debug
correct calc for maxX/Y values