SPH implementation