Assignment 5: finished the first two part