finished template class
added test purposes.
modified some template files.