Updated relative path calculation