Add function to set primary kernel