I figured out why the walls were curved. The original code gave the following relationship between drawn wall height (h) and distance from the screen (d): h = a - b*sqrt(d). (where a and b are some constants) What it should be is: h = a / d. (where a is a constant) This is the change that I made for this remix. There is still a slight amount of curvature at the edges due to the way the distance finding engine works.
Thank you @ScratchBrother123 for catching a bug from the original project