slight edits to functions