following the previous assignments and example slides to write the