finished extrusion algorithm