add -pg support, globals removed