add testability
first test and first bugfix