integrated the function calls and working through pyswip bug