Nats and Pirates agree to deal