sequential algo with hueristics