update, a working version