implemented rat tracking