while and if else, function calls