update information theory code for more idiomatic use