modified to receive files