 }
 
 public class chan<V>: SendChannel, RecvChannel {
-	private var waitingForSendQ = [WaitForSend<V>]()
-	private var waitingForRecvQ = [WaitForRecv<V>]()
+	private var receivers = [WaitForSend<V>]()
+	private var senders = [WaitForRecv<V>]()
 
 	let q: dispatch_queue_t = {
 		let uuid = NSUUID().UUIDString

	}

	public func send(v: V) {
		var receiver: WaitForSend<V>?
		var sender: WaitForRecv<V>?

		dispatch_sync(q) {
			if self.waitingForSendQ.count > 0 {
				receiver = self.waitingForSendQ.removeAtIndex(0)
			} else {
				sender = WaitForRecv<V>()
				self.waitingForRecvQ.append(sender!)
			}
		}

		if let receiver = receiver {
			if !receiver.send(v) {
				send(v)
			}

		} else {
			if !sender!.waitForRecv(v) {
				send(v)
			}
		}
	}

	public func recv() -> V {
		var sender: WaitForRecv<V>?
		var receiver: WaitForSend<V>?

		dispatch_sync(q) {
			if self.waitingForRecvQ.count > 0 {
				sender = self.waitingForRecvQ.removeAtIndex(0)
			} else {
				receiver = WaitForSend<V>()
				self.waitingForSendQ.append(receiver!)
			}
		}

		if let sender = sender {
			let (v, _) = sender.recv()
			if v == nil {
				return recv()
			} else {
				return v!
			}

		} else {
			let (v, _) = receiver!.waitForSender()
			if v == nil {
				return recv()
			} else {
				return v!
			}
		}
	}


		var receiver: WaitForSend<V>?

		dispatch_sync(q) {
			if self.senders.count > 0 {
				sender = self.senders.removeAtIndex(0)
				sender!.comm.onReady(onReady)
			} else {
				receiver = WaitForSend<V>(syncedComm: SyncedComm<V>(onReady: onReady))
				self.receivers.append(receiver!)
			}
		}

