Slightly more idiomatic numpy usage