Add additional asserts, consts, comments, and consistent variable names.