merged core and bd from egfrd branch