include <algorithm> properly