First working draft. Hope this helps someone else!