documentation, junit tests, some enhancements