wip rewrite

wip rewrite