all functions moved to .h. no more compile errors