hw1: parts 4&5