moved protos to upap.c