small changes within the retrieve_sequence function.