separate function from .h to .cpp