solving recurrences