almost done with trends.c