Worked out how to do the update_canvas function (for now anyway).