re-write tuple/sequence/joint loop; re-arrange fun