Updated code, there are some problems with the finite differences in parallel