use bool type instead of int where it's appropriate.