solved part B and C