functions moved into libraries