change assignment to equality in while loop.