Cleaned up main and added import for Document class