added code

code, and diagrams added.