adding some more code snippets to demonstrate how this will work. Content still needs to be filled in.