the only difference is I used randomness that could make it faster if you want to use credit me because stealing is bad