finished part A of Lab3