changes from david, still a wip