Added some comments and fixed render arrays