gh - pchart function - tighten up code