major update, see source