new method to convert int to byte array