Blocks are Rendering Wrong

Hello

I am trying to display blocks on the screen, but it complete renders wrong.

This is my code: http://pastebin.com/DH5h4NXp

And the output is as following:

Does anyone know why this happens?

Thanks.