It was that directional script. Using arctan is weird, I don't exactly remember the reason why, but just use my arccos code instead, it should be consistent I might be misunderstanding this though