my intlist fold implementation