Re-implementing ERM

Reimplementing_ERM