Handled final and inital State
Added isPatternValid method (nfy)
Added finalState and initialState methods
Finalized isPatternValid method