Changed a lot of things to make date retrieval work