simplify AST implementation and allow add() method to accept arrays at any position