Changed GetBuffer to ToArray since GetBuffer would leave a lot of empty possitions after the data