add shift-or algorithm