bugfixes and first succecssful test