updated with encapsulated gg library