documentation overhaul

added detailed member-level comments to every function definition