Modified getLoopDirection

Modified the method getLoopDirection to set direction as UP if the step is not provided since the default value is 1.