Enhanced sample. Added documentation for all significant methods.