made a unifed E_arr function