function jointAngle = moveBoxToItsColorSpot(jointAngle, joint1,joint2,joint3,joint4,joint5,result,WHITE,GREEN,BLACK,YELLOW,BLUE,RED)

if result == GREEN;
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % % point1 - above green
    jointAngle(3) = smoothMove(jointAngle(3), 150, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 10, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 180, joint5, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 172, joint1, 2)
    jointAngle(4) = smoothMove(jointAngle(4), 45, joint4, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 120, joint3, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 132, joint3, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 135, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 60, joint2, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 58, joint2, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 62, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 160, joint5, 2)
    
    jointAngle(6) = 1;
end

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % point3 -  above red
if result == RED
    jointAngle(3) = smoothMove(jointAngle(3), 150, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 10, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 180, joint5, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 165, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 162, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 165, joint1, 2)
    jointAngle(4) = smoothMove(jointAngle(4), 55, joint4, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 30, joint2, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 90, joint3, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 160, joint5, 2)
    jointAngle(7) = 1;
    
end
%

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % point3 -  above yellow
if result == YELLOW;
    jointAngle(3) = smoothMove(jointAngle(3), 150, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 10, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 180, joint5, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 160, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 158, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 162, joint1, 2)
    jointAngle(4) = smoothMove(jointAngle(4), 62, joint4, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 45, joint2, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 125, joint3, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 115, joint3, 2)
    
    jointAngle(5) = smoothMove(jointAngle(5), 160, joint5, 2)
    jointAngle(8) = 1;
end

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % point3 -  above white
if result == WHITE;
    jointAngle(3) = smoothMove(jointAngle(3), 150, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 10, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 180, joint5, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 168, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 173, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 170, joint1, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 100, joint3, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 108, joint3, 2)
    jointAngle(4) = smoothMove(jointAngle(4), 50, joint4, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 40, joint2, 2)
    
    
    jointAngle(5) = smoothMove(jointAngle(5), 160, joint5, 2)
    jointAngle(9) = 1;
end



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % point3 -  above blue
if result == BLUE;
    jointAngle(3) = smoothMove(jointAngle(3), 150, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 10, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 180, joint5, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 180, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 175, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 180, joint1, 2)
    jointAngle(4) = smoothMove(jointAngle(4), 40, joint4, 2)
    
    jointAngle(3) = smoothMove(jointAngle(3), 120, joint3, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 115, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 50, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 160, joint5, 2)
    jointAngle(10) = 1;
end

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % point3 -  above black
if result == BLACK;
    jointAngle(3) = smoothMove(jointAngle(3), 150, joint3, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 10, joint2, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 180, joint5, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 155, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 152, joint1, 2)
    jointAngle(1) = smoothMove(jointAngle(1), 155, joint1, 2)
    jointAngle(4) = smoothMove(jointAngle(4), 65, joint4, 2)
    jointAngle(2) = smoothMove(jointAngle(2), 40, joint2, 2)
    jointAngle(3) = smoothMove(jointAngle(3), 100, joint3, 2)
    jointAngle(5) = smoothMove(jointAngle(5), 160, joint5, 2)
    jointAngle(11) = 1;
end
