optimized tile rendering; needs cleanup