V8i MDL Always Getting 0 in level id

Hello,
I'm sort of new to Microstations and have been tasked with upgrading MicrostationsJ(v 7.0) mdl code to work in v8i select series 4. I've hit an issue with a function that simply gets the level for an element. I've read that levels in Microstations 7 to 8 changed quite a bit, so I know I would have to rewrite the code for this funciton.

The existing function in v7 used the old method of obtaining the level by traversing an array of short integers and the level could be 1 to 63.

So here is my plan to rewrite the funcction to get the level in v8i

1. Use the mdlElement_getProperties function to get the level id of an element. Note that I realize that this is an internal id and does not equate to the level id in v7.

2. Use funcciton mdlLevel_getName to get the level name from the internal level id. The level name is significant to us, since it seems to equate to the old v7 level, example Level 71, Level 42 ect..

My problem is that in step 1, I always get back a 0 for the internal level id.
So when the code below runs I always see the following for each element: this is for thousands of elements always 0. I never see the line good level if the levelid is not 0.

element is graphic
level id: 0

I've commented out the call to mdlLevel_getName, since it seems pointless to call it for now if the levelid is always 0, and don't mind that I am returning 1 form the funciton, this is just for testing for now.

couple of more things:
I will post full code for my program in a reply to this post. this is a test program that I run from the command windows. The program does a file scan of each hard-coded cell then reads each element in the cell.
I know these elements are good because I had code in this program (that I removed for readability) that successfully got other information off the element after the call to getItemLevel.

The dgn that I am using is from v7, so when I opened it in v8i the first time, it converted the file. There is only 1 default model. And if I go into the dgn in v8i, I can see the levels exist that I am tring to get the level name for.

I kow that the way that I am scanning the file is outdated and I will be looking to changing that after I get past my current issue with the levelid.

So here is my question?
What am I doing wrong? Am I on the right track for retreiving the level name for an element or is there another way to do this? If I am on the right track then why am I always gettting a 0 in the levelid?

Help for my issue would be greatly appreciated. I've searched these forms and the reference material without success.

Public int getItemLevel(MSElement *elP)
{

MSWChar levelName [50];
UInt32  levelid;

                 //elements are graphic
                 if(elP->ehdr.isGraphics)
                 {
                  fprintf(fres,"\n element is graphic");  

		  mdlElement_getProperties ( &levelid , NULL , NULL , NULL, NULL , NULL, NULL, NULL, elP );
		  fprintf(fres,"\n level id: %d", levelid);
                  if (levelid != 0)
	   	  {
		    fprintf(fres,"\n good level");
		  } 

/*
                 if (SUCCESS == mdlLevel_getName( levelName, 50, MASTERFILE, levelid ))
                 {
                   fprintf(fres,"\nlevel name = %s",levelName);
                 }
*/	
                }




	return 1;
}