Add tests + improve documentation