basic pg wrapping functionality