gLoop sample code.