added main code for erosion