WIP: adding earned yesterday support
Further improvements.