adding documentation and some tests