cleaned up a lot of code. began on rebuild.