added final changes to allow for space dependent reaction systems