added pet class and fixed the i in the main method