replace tic,toc with @time
removed unnecessary copying of x