3 Algorithm and software implementation