Added a messy but working implementation that works hurray.