Nested ifs fixed! (maybe?)