Min length search reduced. Link to github for code.