conversion to flags instead of priority
removed priority
renamed flags
method renames
fixed byte array
updated version