finish index and rule