template mostly done