Solution to q 5