more idiomatic, less efficient