some more additions/improvements to the template functions
Added more features