Got index lookup working properly (maybe introduced performance issues)