updated psuedo code