even more commenting and psuedo code