added missing page resources to definitions
minor layout changes and adjusted spacing
changed source code picture to pdf