Remove some old time stuff and fix the test for whether this is the first time we have come across a particular variable