Slightly refactored "code memory" type.  While loops now seem to work reasonably well.