finished part a of Lab4