working on template, a lot of bugs yet