auto pilot used to crash. Figured that std::string::npos returns size_t. p was declared as unsigned int p