complete hw1-3 code