changed argument handling to be more idiomatic.