add edit mesh function and wiring