fixes + added some code documentation
updates
added some unit tests