Nevermind

Edit: It doesn't appear to work in a certain scenario. Will look into seeing what I've done wrong.