Function and while syntax