improved read. put in function and added repeated start bit. 
cleanup in the unused code.