Diagram added, some fixes