avoid storing all intermediate solutions