First sort-of working, patched in (test currently eyeball only).