Better optimization and some graphical updates