Added function to calculate directly the altitude