Improved page rendering. Now it adds and deletes dom elements.