I don't quite like the bit shuffling... but we can fix that later