Work on making rest days automatic and a full refactor of the algorithm