Friends with your ex? This study says you should ask yourself why