finished documentation of general functions