Calling functions in IF-ELSE