Cleaned up some code and fixed a few things. Need to change the request address

in the read function to accept local variable. Nead to clean up write function.