added swig and consolidate