``` function rotate_atc_from_to(atc, previous_pocket, next_pocket) { atc.direction = "Shortest" atc.from = 360/12 * previous_pocket + 90; atc.to = 360/12 * next_pocket + 90; var slots_num = 0; var direction; slots_num = previous_pocket - next_pocket; if ( slots_num > 6){ slots_num -= 12; } if ( slots_num < -6){ slots_num += 12; } if (slots_num > 0){ direction = "CCW" } else if(slots_num < 0){ slots_num = slots_num * -1 direction = "CW" } atc.duration = slots_num * 1000 atc.restart();