added tests + small changes