Further tweaks

I know the code looks bad, but the end result is worth it