Add indicies for better performance

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Merge branch 'improve-performance' into 'master'

Improve performance

Fixes #115

See merge request !81