lab5.s - check_recurrence implemented