Reworked update routine