added a check for so the second transformation pass isnt run if there isn't a barrier, but need to handle returns