More optimal int->tuple tuple->int operations