simplify code and replace ascii codes with bytes for readability
add some todo tasks
use buffer instead of byte[]