Polished up G3d library