Added profiling library (and inserted macros) and moved mallocs and frees outside of loop
making progress to next update
Now faster than cpu version, but with hideous pointer bug