minor edits to make code clearer