This seems nice: http://stackoverflow.com/a/15075609