Auto-generated boilerplate stuff, with a little alteration.