Optimization

Convert a branch to some bitwise math.