Erosion algorithm done. Untested and might be wrong, but should be close.