notes on implementing an algorithm