Shortened up demo code to only show necessary code.