Second version with GPU