Added log data option// Cleaned some unused code