Separated algorithm update from gui update. Added resizing.