fixed the wrong assetions.
fixed code to accept consecutive unary elements such as '(('.