Rewrote inventory rendering code