em working version for 1D