WIP:in EM, todo scaling
fixed conflict between original repo and my changes