tidied up spherical harmonics code (mostly removed commented out code
and temporary for debugging)