Divide By Two Algorithm