add recursive print function