altitude function fixed and tests working