Arduino project IR controlled LED's

Hi there guys! I've spent part of my holidays to make this project for my school. But i think it's kind of begginer-like. So if anyone could help me to enhance it a little bit... With the help of the almighty internet and couple of manuals i've managed to set up theese two codes.

#include <IRremote.h> //adds the library code to the sketch
const int irReceiverPin = 2; //pin the receiver is connected to
const int ledPin = 13; 
IRrecv irrecv(irReceiverPin); //create an IRrecv object
decode_results decodedSignal; //stores results from IR detector
void setup()
    pinMode(ledPin, OUTPUT);
boolean lightState = false;
unsigned long last = millis();
// Start the receiver object
//keep track of whether the LED is on
//remember when we last received an IR
void loop()
    if (irrecv.decode(&decodedSignal) == true) //this is true if a message has been received
        if (millis() - last > 250) {
            //has it been 1/4 sec since last message
            lightState = !lightState;
            //toggle the LED
            digitalWrite(ledPin, lightState);
        last = millis();
        // watch out for another message
#include <IRremote.h>
// IR remote control library
const int numberOfKeys = 1;
const int firstKey = 4;
// the first pin of the 5 sequential pins connected to buttons
boolean buttonState[numberOfKeys];
boolean lastButtonState[numberOfKeys];
long irKeyCodes[numberOfKeys] = {
    0x18E758A7, //0 key
IRsend irsend;
void setup()
    for (int i = 0; i < numberOfKeys; i++){
        int physicalPin=i + firstKey;
        pinMode(physicalPin, INPUT);
        digitalWrite(physicalPin, HIGH); // turn on pull-ups
void loop() {
    for (int keyNumber=0; keyNumber<numberOfKeys; keyNumber++)
        int physicalPinToRead=keyNumber+4;
        buttonState[keyNumber] = digitalRead(physicalPinToRead);
        if (buttonState[keyNumber] != lastButtonState[keyNumber])
            if (buttonState[keyNumber] == LOW)
                irsend.sendSony(irKeyCodes[keyNumber], 32);
            lastButtonState[keyNumber] = buttonState[keyNumber];

As you can see first code is receiver second is sender. So... any sugestions what should i do to make it better?