got it working -ish