added flag for dephasing
added switch for dephasing, new RHS function