define functions as inline to keep compiler happy