Minor correction to while statement for extra work