all code from old plugin plus start of code completion