Updated to include optional -i, for case-insensitive searching