implementing the changes from the lab