duplicate NL removed. bytearrayutil code commented throughoughly