working version, still needs a detection vector