Here is an elegant solution