Fixed several bugs in cuda code, paritularly relating to hopping greater than 1