add diagram of algorithm