this is definitely a rough-draft implementation and is going to need a v2 or v3 to plug all the serious holes.