tweaks to bookcode and load inventory loop