Added z-template class and finished it