got templated functions working