changed cond in while to has.int