added a test, but that reminds me - I need to find a way of reading the index and should probably use in-memory indexes for tests