Shuffling code and commenting based on OpenCL tutorials.