Basic erosion implemented.  Some refactoring (needs more)