Trying to figure out logic for order of if else if else.