completed hw3 at last ! :)