fixed index error in buildSolutions