Well done, I was struggling with this exact problem last week.