updated generate_sphere()