Corrected small bug in logic. Testes still passing.