cleaned and commented 7 through 15