adding tests + some fixes