Working, faster than C code