make a separation function