added cli control
changed count to a more reasonable one
made searchPatterns recursive, which enables searching till Infinity