Reimplemented update function, which is tested and working as expected so far. Reimplementation of bubble functions necessary.