fixed a few bugs in the code and the documentation