'data' added and internal function 'checkClass' added.