This is an ugly, kind-of-brute-force solution. I'm not proud of it, but it works and got me top 1000 on both parts. I also changed the "which day to run if no day is specified" to just always choose the highest numbered day.