basic working version
finished wrap, re-organized types