Could do with some tidying up but seems to work OK.
For now only lookup takes a list of indices. Insert! is hardcoded to two indices.