Converted to better pwgl structure