Changed some things
Made it check for if the end result has >, not the begining for ]