This is the code I use:
http://www.glsoftworks.pastebin.com/f29375c3d

Can you help me out now?