add calc for pathloss, and fix calc for paragain