added a method to reverse binary representation using an array of characters