Moving almost all logic into the HeightMap class