Where is this used? You redeclare val indx lower, so this doesn't seem used?