reorder bits and fix timing