Initial implementaiton of balanced parentheses interview question