Raycast fisheye fix?

So my raycaster is almost complete, it just needs a fix for the fisheye, I know why it occurs but don’t know how to fix it with the system I used

Currently my idea is to find the difference between an edge ray and a middle ray on a flat wall and then scale that based on the list but I don’t really know how to do that

If you have even the slightest hint please please tell me

This is very close but I think it’s still incorrect

(the “[] min - []” block subtracts the biggest value in either input by the smallest value in either input to make the proper scaling with the center)