moved fn definition from .h to .cpp