Updated heightmap code - sphere is now generic code