Added a compare function to the ByteArray class