fixed a bug where when maxX isn't specified, accidentally took max(y)