My 3x3x3 and 5x5x5 LED cube

Hi. im an arduino newbie as well and I just built a 3x3x3 led cube this weekend and wanted to ask you a couple of questions. I built the cube and made sure all the pins worked but got a little bit stumped when it came to programming since it was my first time. Just from reading through these posts I understand now that it is smarter to light up each layer at a time so I have a 1/3 duty cycle. (I was doing 1 led at a time with 1/27th duty cycle. :*) But my first question is why use transistors? I hooked each layer up to a specific pin and when I want the layer off I just set the pin to HIGH. Is there an advantage to using transistors?

My next questions is going to be about how you simplified your code. But im going to rewrite my coding a little tonight just so I can see the cube in action and then I will post it.

Thanks in advance! and good work, I hope I will learn as fast as you did!