Removed a duplicate if statement, added a lot of puts to see what's happening