binary and linear solution for celetric. Linear is too slow, but why the binary way dont work