solved Problems 6-8