Changed IF statement completely so it actually makes sense