Cleaning up and starting up a buffer function
Working on big endian support