Moved sample detection out of the method and put it into KGERS execute method.