added notes to psuedo code