make function that save as byte file