resolved conflicts
change forEach to for loop to use break
added reset function
Merge pull request #5 from intoxicated/master

Implemented most of match function logics