fixed errors resulting from shifting the tds