HitPattern resized. Added index based insertion. Added some printouts for debugging index_hit problem.