bug fixes
added index generator and test