fixed memory allocation error, the error was in the call sequence of rp1 in flux1. Made the code in flux3 and solver cleaner