Got rid of useless while