updating script to handle new format