solved Problems 2-5