finished documentation. TO DO: white box tests