updated with date sorting