Rewriting uv sphere algorithm.