added direct output method with proper header