fixing indexing issues, added support for interactive learning