At a first quick glance it looks ok. The only recomendation I would make is to put more documentation in the code with coments on what lines do what. It may seem to make sense at the moment, but a few years from now if you ever had to go back to it you will probably be scratching your head wondering what you were doing. (Been there, done that).