Remembered length rules

“The object is to draw an oriented closed loop — oriented meaning it has a defined forward and backward direction — passing through every grid square exactly once through adjacent squares. The grid has some rooms given, and some have given numbers. Rooms may be visited any amount of times. Each time the loop exits a room with a number N, it must pass through exactly N squares in the nextroom it visits before exiting. Rooms without given numbers have no such restriction; the lengths of the paths in the next visited rooms may all be the same or may all be different.”

-rules as written by Palmer Mebane, inventor of remembered length

Below is an example puzzle and its only solution. The orientation of the loop, which is unmarked in the image, is that it is going down at the top-left corner.