recursive function cannot be inline