5/4/14 - added length() template to functions