refine X Y and E steps