structure changes

bit tidier, still loads to do