cleaned code, storing messages on disk now.