pseudo-code of algorithm