restructured and worked on homework 1