added documentation in code