Proper data output (and Python 3 compatibility)