template more or less complete now