Improving bit interleaving algorithm