fixed the final bug I had a hunch about