include number of bits read as a sanity check
simplify keyboard interrupt handler
use consistent brace style
remove unnecessary function