speed up dates, only calculate x once