Tweaks and starting to get a semi-working implementation