Lots of changes to resolve compile-time errors; still getting vtable error for legalid class