initial working version (incl. JUnit testing!!)