more cleanup
add function to retrieve bit from byte