sorting keys (thanks @hodgestar)