moonlite25 0 Newbie Poster

Hi, I am coding a program to make a rolling box function using turtle graphics. The box is supposed to appear to be rolling across a floor to the right like this: http://img194.imageshack.us/img194/2944/rollingbox.png
There are supposed to be three function parameters:
length for the length of a side, numDivisions for the # of divisions in a single 90 degree rotation, and count for the # of times to repeat a rotation.
The code I have so far is this: http://img530.imageshack.us/img530/3875/codez.png
The original picture on how it is supposed to look like has 3 divisions and 4 counts of rotation. My code does not go in a straight line, it goes around in a circle. I'm new to python and I am stuck on how to make my function appear like the original picture. What am I doing wrong?

Also: To move the pointer to the right side of the second square to keep it horizontal, I have to make the function stop when the square has completed one 90 degree rotation. I also have no idea how to do that.

I really would appreciate help.