It could be done differently, I suppose. This solution was the first thing that came to my mind.