added subclass function and file loader