math/bug fix for inventory draw loop