Some changes in save_sol and res_calc for testing