week1 of algorithm class, not finished