finally working for hw3