class working - issues with C functions