bugfix: segmentation fault
improving documentation
writing tests