Oh and something i noticed about your code.
Is a bad idea. That creates a sphere with 100 segments, with roughly 39,000 polygons.
CreateSphere(100)
Is a bad idea. That creates a sphere with 100 segments, with roughly 39,000 polygons.