Compiles and runs; outputs off by a bit (distance alg problem)