Wrote the init function for the pet class