implemented prototypal inheritance