some code for algorithms on coursera