working version of backward