interim solutions for challenge 5 and 6