overflow problem solved in a very crappy way
bof...