Sumner erode algorithm seems to be working now!