added path calculation for ~ sign - fixed #198