Put a stricter limit on smartResetHelper

Added a stricter to the limit on the for-loop in smartResetHelper, as it was going to the end of the
episodic memory, but every iteration adds an element to the episodic memory.