finished osprd.c