added swig for templating