Updated Pattern class, changed the node to start from PatternNode

Signed-off-by: Benjamin <benchisa@gmail.com>