parsing tuples in terms