added documentation as well as testing