clamped grid masses to >= 0 to avoid nans
added virtual destructors to stop the compiler complaining
added cortex particle caching