hw 4 code portion