public function set($keyPath, $value)
    {
        $stops = explode('.', $keyPath);

        $currentLocation = $previousLocation = $this;
        foreach ($stops as $key) {
            if ($currentLocation instanceof Collection) {
                // Move one step deeper into the collection
                if (!($currentLocation->$key instanceof Collection)) {
                    $currentLocation->$key = array();
                }
            } else {
                $currentLocation = array();
                $currentLocation->$key = array();
            }
            $previousLocation = $currentLocation;
            $currentLocation = $currentLocation->$key;
        }

        // Set the value
        $previousLocation->$key = $value;
    }