now with psuedo code