add calculate path feature and fix some issues