add new bit-banging code from Darron