implemented "balanced parenthesis" task