Annotated diagram
Code cleanup