Should `id` not be pushed to `byTimestamp`? Could you explain how the code above work?