some edits to rmax calc