#248 index entities and also fix a bunch of stuff