simply modified from clowwindy's gfwlist2pac