Fixed example, still barely functional but shows how it works.