sph code complete. need debugging & parameter tuning.