valgrind check doku added
valgrind test added
code improvement