 	        try! connection.send(Data(self.requestToString(request)))
 
 	        //receiving data
-	        let received = try connection.receive(lowWaterMark: 1, highWaterMark: 1024)
+	        let received = try connection.receive(max: 1024)
 	        //converting data to a string
 	        let str = try String(data: received)
 

import HTTPSerializer
import S4
import ConnectionPool

public class CrateIO {

    var socketPool : ConnectionPool<TCPClientSocket>
    var currentSocket = -1

    public init(pool connections: [TCPClientSocket], using configuration: CratePoolConfiguration) throws {
		    socketPool = ConnectionPool<TCPClientSocket>(pool: connections, using: configuration)
    }


    public func sql (statement: String) throws -> JSON? {

        // Get a connection from the pool to use.
	    return try socketPool.with({ connection in
// print(ObjectIdentifier(connection).hashValue)

	        let request = try Request(method: .post, uri: "/_sql", headers: headers, body: post)

	        let requestData = Data(try self.requestToString(request))
          // print("About to send")
          // print(requestData)
	        try! connection.send(requestData)
          // print("Sent")
          // try! connection.flush()
	        //receiving data
	        let received = try connection.receive(max: 1024*1024)
          print("Received: \(received)")
	        //converting data to a string
	        let str = try String(data: received)

	        print("received: \(str)")

	        let parser = ResponseParser()

