Added: helper functions and comments to pg components