Changed optimizer so that it accepts 1 len solutions