Create pbc function for gol