modified createSpeedRectangle method