added detailed solution to 5f