It's my fav= D btw, Lelouch is a French word (according to my French friend), incase you're confused about it.
SPOILER ALERT DO NOT READ BELOW THIS (does not know how to use the spoiler thingy)
As for the ending, Lelouch did what he did because that was how he planned it. He saw he got screwed when the Black Knights turned on him after hearing about Geass, so he made the plan to kill the Emperor, rule the world with an iron fist to make Britania nothing but a symbol of pure hatred and evil, then let the icon named Zero kill him, saving the world from an evil ruler, and saving the world from a bleak and horrible future, and making Zero the hero Lelouch originally wanted him to be from the very very start. The only difference between then and now is that Lelouch is the one to die, not the Emperor, but it holds the same effect.
Hope that clears that all up :3 *is a Geass nerd*