implemented local solve, coded out implicit solver