minor: Unsigned int elevation, and you won't have to check >= 0 . Also, stylistically better