added junit and bugfix