assignment completed. filled in functions commented code