Implement final changes; add comments

Add comments to several portions to clarify process,
and added output verification.