refactored to use dayNum instead of _id