worked on wgl code