works correctly on my test files