typo in script not getting the max elevation