Finished GPU implementation