made more idiomatic