fixes and improvements; finalized documentation