AG: comments on functions added.