Add header. Changed neigbor cost value to distance. Fixed type mismatch. Removed debugging statements.