cleaned up the code

put in reachability and added a reload button