fixing branching statements