put ymax calc in right place