debugs restraining and removes obsolete code from restraining