Lessons from May’s electoral debacle