Rewrote the whole item placing algorithm