unused variables removed,some comments cleaned up,sending data to webserver added