move memory allocation into add_solution