sexp manipulation functions