Minor updates to the code to phase according to grandparents