basis of algorithm implementation