hw3 code