implementing some swig stuff