added functions for getting back alternate, next and previous indexes of rules of table of rules