Added an flag to choose whether to write solution files or not