more idiomatic array & pointer usage (per @mjibson)