The malpighian tubules are thin, long, filamentous, yellow coloured structures attached at the junction of the midgut and hindgut. These are about 100-150 in number and are present in 6-9 bundles. Each tubule is lined by glandular and ciliated cells and the waste is excreted out through the hindgut. The glandular cells of the malpighian tubules absorb water, salts, and nitrogenous wastes from the haemolymph and transfer them into the lumen of the tubules. The cells of the tubules reabsorb water and certain inorganic salts. By the contraction of the tubules, nitrogenous waste is pushed into the ileum, where more water is reabsorbed. It moves into the rectum and almost solid uric acid is excreted along with the faecal matter.