Revised to be more idiomatic.