add tests, fix pipes