updated from hw3.3 work