Fixed pattern generation error : starting value was not working, used && instead of || and set NSNumber to 0