New class function that handles inheritance

Run test.html to see example