An elegant solution to a simple problem