Simplified the 'get_fwpath' function