           (let [json (encode-command command)]
             (>! channel json))))))
 
+(defn send-command [command channel]
+  (send-commands :commands [command] :channels [channel]))
+
 (defn pending-checker []
   (go-loop []
     (<! (timeout 3000))

    (update-global-state (comp #(add-channel % channel uuid)
                               #(add-pending % uuid)))
    (u/log "Processing game-request and generating uuid: " uuid)
    (send-commands :commands [{:type :game-request-ok
                               :data {:uuid uuid
                                      :pending (get-pending-players (current-global-state))}}]
                   :channels [channel]
                   )))

(defmethod handle-command "start-game-ok" [command channel]

            [channel1 channel2] (map #(channel-for-uuid (current-global-state) %) pending-pair)
            game-id (u/gen-uuid)]
        (u/log "Taking two players for game " game-id " with uuids: " pending-pair "\n\n")
        (send-command {:type :start-game
                        :data {:game-id game-id
                               :enemy uuid2}}
                       channel1)
        (send-command {:type :start-game
                        :data {:game-id game-id
                               :enemy uuid1}}
                       channel2)

        (update-global-state add-game game-id (f/make-game uuid1 uuid2))
        (update-global-state #(apply remove-from-pending % pending-pair))))
