need to change if-statements to only be first class when containing a barrier