success while and if statement