my understanding of algorithm