completed and code checked by Cynthia