Updated script to handle a wider range of sample names.