main updated to receive files