Search For the beginning and the end