Added c++11 for compile with gcc
Changed to not pass pointer of temp vars to method