Renamed hd/tl. Added more test cases.