Software SPI.transfer (Solved!)

It took a while, but I ended up writing it myself!
At first replacing the function didn't work at all, but that ended up being because the SPI was still "on", so I couldn't write to the 13 and 11 pins myself..

Here's the code:

uint8_t softSpiTransfer(uint8_t shOut){
  uint8_t shIn = 0;
  for(int i = 0; i < 8; i++) {
    if (shOut > 127)  digitalWrite (outPin,1);
    else              digitalWrite (outPin,0);
    if (digitalRead(inPin)) shIn += 1;
    digitalWrite (clkPin,1);
    digitalWrite (clkPin,0);
    if (i != 7)	shIn <<= 1;
    shOut <<= 1;
  }
  return shIn;
}