original version
binary reading