use c++11 std lib (include functional)
correct template variable declaration/allocation