draft version

conditions for using index might be optimized later