working example

needs a lot of clean up :(