added toByteArray util