There should not be a space after "while". This occurs in more places.