Wrote a GetBytes function