cleaning up function.sphp