calculate tuple just once per loop