hw3 functionality finished