added code to weight and log pet data