working for the GPU as well