several fixes and stable indexing
several improvements to indexing and code cleanup