some fixes in the code; creating documentation; fixing some testcases