added documentation and edited some methods