pretty much complete rework