pretty much a totla restructure from fork