Added patch to calculate displacement of string