Added user input by variable tables, fixe dnegative value indexing