interleaving functions