Tweaked the altitude calculation

Still very buggy. Need to fiddle with the altitude calculation
parameters.