added support for spheres and modified code so its easier to add shape types