sorting out references