lots of codework to match dates added. fixes issue#1