add diagram and make some corrections