Code with required changes for DUNE