Drafted xriver.c, not done