made a lot of changes, basic outline