Rewrote algorithm to better handle piece placement.
Added case to handle corner pieces that come out on the edge
Further algo changes