added new implementation for parantheses matching w/o hashmap overhead