Final GPU implmentation