first version with one single algorithm