moving functions into a library...