cleaned up and added graphite connection stuffs