Debugged and fixed renderer