cleaned up code, fixed directory errors and added recognition for HTTP version request