Test code for pgs