changed various functions to use lp's scratch space for ind and vals