Added documentation.
Edits, documentation, added input constraints.