Fixed a few conditions, now works on the TA's sample input! Yipeeee