Script for extracting sequences