typo correction.
reorganize if then structure