Implemented diffuse material and fixed many runtime bugs