Added template SPHERES code.