a long way to optimize for gpu