first attempt at Tuple optimization
fix #613 applying patch from @jvasileff