I'm writing a 3d snake game and am having a problem with cube wrapping. I want to go around the cube in any which way but my connections are all wack could you help me? 
here's my wrapping code let me know if you need any additional context:                 // Handle wrapping to adjacent faces
                if (row < 0) {
                    // Move to adjacent face
                    switch(face) {
                        case 'front':
                            face = 'top';
                            row = 9;
                            break;
                        case 'back':
                            face = 'top';
                            row = 9;
                            break;
                        case 'top':
                            face = 'back';
                            row = 9;
                            break;
                        case 'bottom':
                            face = 'front';
                            row = 0;
                            break;
                        case 'left':
                            face = 'top';
                            row = 9;
                            break;
                        case 'right':
                            face = 'top';
                            row = 9;
                            break;
                    }
                } else if (row > 9) {
                    switch(face) {
                        case 'front':
                            face = 'bottom';
                            row = 0;
                            break;
                        case 'back':
                            face = 'bottom';
                            row = 0;
                            break;
                        case 'top':
                            face = 'front';
                            row = 0;
                            break;
                        case 'bottom':
                            face = 'back';
                            row = 0;
                            break;
                        case 'left':
                            face = 'bottom';
                            row = 0;
                            break;
                        case 'right':
                            face = 'bottom';
                            row = 0;
                            break;
                    }
                } else if (col < 0) {
                    switch(face) {
                        case 'front':
                            face = 'left';
                            col = 9;
                            break;
                        case 'back':
                            face = 'right';
                            col = 9;
                            break;
                        case 'left':
                            face = 'back';
                            col = 9;
                            break;
                        case 'right':
                            face = 'front';
                            col = 9;
                            break;
                        case 'top':
                            face = 'left';
                            col = row;
                            row = 0;
                            break;
                        case 'bottom':
                            face = 'left';
                            col = 9 - row;
                            row = 9;
                            break;
                    }
                } else if (col > 9) {
                    switch(face) {
                        case 'front':
                            face = 'right';
                            col = 0;
                            break;
                        case 'back':
                            face = 'left';
                            col = 0;
                            break;
                        case 'left':
                            face = 'front';
                            col = 0;
                            break;
                        case 'right':
                            face = 'back';
                            col = 0;
                            break;
                        case 'top':
                            face = 'right';
                            col = 9 - row;
                            row = 0;
                            break;
                        case 'bottom':
                            face = 'right';
                            col = row;
                            row = 9;
                            break;
                    }
                }

                return {face: face, row: row, col: col};
            }