Added missing include of algorithm