added testcases, added logging, added first concurrency test, refactored code