Infra RED control

Hi!
I have such a hard time trying to copy ir codes (make universal remote).
What i would like to do is point a remote to the sensor, record the bytes (hex format maybe) and then replay that same code on the IR LED. I was trying to use IRRemote that i guess came with Arduino 1.6.5. I am not sure, though, i might have dowloaded it.
Now it didnt work, so i went to

and dowloaded the zip and replaced IRremote lib i had before. (as this one has samsung codes and the other one didnt, nevermind that now).
This is the IRsend demo (wtf?)

/*
 * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
 * An IR LED must be connected to Arduino PWM pin 3.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include <IRremote.h>

IRrecv irrecv;

void setup()
{
  Serial.begin(115200);
}

void loop() {
  if (irrecv.isIdle())
  Serial.println("Idling");
}

So i tried my code from before but the irled doesnt light up anymore.

#include <IRremote.h>

int RECV_PIN = A0;
int RELAY_PIN = 4;

IRrecv irrecv(RECV_PIN);
decode_results results;
IRsend irsend;

unsigned long ircode = 0xE0E040BF;
unsigned int irbuf [6] = {0xE0E0,0x40BF,0xFFFF,0xFFFF,0xFFFF,0xFFFF};

void setup() {
  pinMode(RELAY_PIN, OUTPUT);
  pinMode(13, OUTPUT);
    Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  irsend.sendRaw(irbuf, 6, 38000);
  delay(1000);
}

Could someone point me to the right place to look as there is a ton of examples switching on/off a led, but how does one record and store signal from the remote and replay it later - simple?
The samsusng power button yields following when IRsendDemo loaded

Could not decode message
Raw (68): 31146 4450 -4450 550 -1700 500 -1750 450 -1750 500 -550 550 -550 550 -550 550 -650 450 -600 500 -1750 450 -1750 500 -1650 550 -600 500 -650 450 -650 450 -650 450 -600 500 -650 550 -1600 550 -550 550 -600 500 -650 450 -650 500 -600 450 -650 450 -1750 500 -600 500 -1650 550 -1700 500 -1750 450 -1700 550 -1700 550 -1600 550 
Could not decode message
Raw (68): 3568 4400 -4500 500 -1700 500 -1650 550 -1700 500 -650 450 -650 500 -600 500 -600 500 -600 500 -1650 550 -1700 500 -1750 500 -600 500 -600 500 -550 550 -600 500 -600 500 -650 450 -1750 450 -600 500 -650 500 -550 550 -550 550 -550 550 -550 550 -1750 500 -600 450 -1750 450 -1750 500 -1650 550 -1750 500 -1650 500 -1750 500 
Could not decode message
Raw (68): 27636 4450 -4450 550 -1700 500 -1650 550 -1750 450 -600 500 -650 450 -650 500 -600 500 -600 550 -1600 550 -1700 500 -1750 450 -650 450 -600 550 -600 550 -550 500 -550 550 -550 550 -1750 500 -600 450 -650 450 -600 550 -550 550 -550 550 -600 500 -1700 500 -600 500 -1750 450 -1750 500 -1700 500 -1750 450 -1700 500 -1750 450 
Could not decode message
Raw (68): 10012 4400 -4500 500 -1700 500 -1750 550 -1600 500 -650 450 -650 500 -600 500 -600 500 -600 500 -1650 600 -1650 500 -1700 550 -550 550 -600 550 -500 550 -550 550 -550 550 -600 550 -1700 450 -600 550 -550 550 -550 650 -450 550 -550 550 -550 550 -1700 500 -650 450 -1700 550 -1650 600 -1700 450 -1700 500 -1700 550 -1650 550 
Could not decode message
Raw (68): -12598 4400 -4550 450 -1700 500 -1700 550 -1650 550 -600 500 -550 550 -650 450 -600 550 -600 450 -1700 550 -1700 500 -1650 550 -550 600 -550 500 -600 500 -600 500 -650 450 -600 550 -1650 650 -450 550 -550 550 -550 550 -650 450 -650 450 -600 500 -1700 550 -550 600 -1600 550 -1700 550 -1700 500 -1650 550 -1700 500 -1650 550 
Could not decode message
Raw (68): 20918 4450 -4500 450 -1700 550 -1650 600 -1650 500 -600 500 -550 550 -650 550 -500 600 -500 550 -1650 550 -1700 650 -1500 550 -600 500 -600 500 -600 500 -650 500 -550 550 -550 550 -1650 550 -550 550 -550 550 -600 500 -650 600 -500 500 -600 500 -1650 550 -600 500 -1750 450 -1700 500 -1700 600 -1600 550 -1700 500 -1700 500 
E0E040BF (32 bits)
Raw (68): -27684 4500 -4400 500 -1700 500 -1650 550 -1700 500 -600 500 -600 500 -600 550 -600 550 -550 600 -1550 550 -1700 500 -1700 500 -600 550 -550 550 -600 500 -600 550 -500 550 -550 550 -1750 550 -550 550 -550 500 -550 550 -550 550 -550 600 -550 500 -1650 550 -600 500 -1700 600 -1600 550 -1700 550 -1700 450 -1700 500 -1750 500

I'm using mega board.

By default, the tx pin on the MEga is D9.

I suggest you work thru all of the examples provided with the library, before starting your own project.

Then see if you can receive signals from your tv remote and then move on to sending.

Also check the doc link in my signature.