Fixed many compilation bugs.Warning comparison flags are left and two functions need to be written.