first version of primer extraction, very dirty