made everything use pass-by-reference
added pictures to docs