added reference date to date calculations