Fixed piece placement algorithm (at last!)