update update function, move printout to DEBUG state