added ability to use a reference date