More powerful sequential implementation (still not good)