implemented one-thread versions of algorithm 34 & 35