simplified but working - need to seperate templates