Changed C++0x to C++11, added include <functional>