added date sorting to plots