pre-inter for tw, minor code changes