changed header and printf to cout