Working byte[] inside of functions