using functions, basic example with recursivity