testing function for hgl