Added dilation and erosion algorithms