added documentation for most functions