added files from old sglib/gpc branch