I think I have a solution that accounts for everything. I get the right answer but that doesn't it works for everything.