some code I write down while I attend algo-class.com