finally working template