Added includes, static function to find command type