fixed a couple of bugs. got path tracing working for ray depth = 2. There is still a weird Heisenbug that I have no idea why it happened and causes segment fault randomly...