a simpler solution