Cleaning up the code and stripping out all the write function since I don't need them