Implementing lab7.