made some changes to ospex.c