implemented prototype inheritance