finished coding last part of assignment7