Assignment 1 for algorithms class on coursera