Homework 2_3 done, still needs some polishing.