fix FPS slow - explore multithreading ray casting time figure out dimension restriction function causing program to crash