moved pattern check into constructor
rewrite syntax-rules match func