Added liquids code donated by KL