I finally figured it out, it took a couple of hours π although to be fair I was making dinner at same time haha. I stumbled upon a stackoverflow post about parseInt(string, radix), console logged to see if worked out to the correct nums, then realised what i had to do.