Working version with graphical updates