Just moved one function to correct a compile problem