updated for swig bindings