starting ex7
solution to first half of p7