Hacky implementation of Manchester encoding