Re define NUM_ELEM

NUM_ELEM looks like it was taken out during a code clean up.
Ive Put it back in.