improved abstraction: created a function to get pet data from CSV file and a main function for the script