Added some code to check access modifiers and component encapsulation.