Improved documentation for functions through addition of post and pre conditions
Improved agreement with manuscript by replacing "groups" with "labels"
Improved agreement with manuscript by replacing "groups" with "labels"
Fixed documentation by replacing "incrementations" with "flat_mask"