Main function now accepts a prototype that the entity inherits from