switched int[] to byte[] for performance