anchor.diff:                  printfn "Program failed to get a list of events. Connection may be at fault."  
                if (eventsResponse.IsSome) then
                   printfn "%s downloaded." (eventsResponse.Value.Length.ToString())
  -                mainLoop baseUrl eventsResponse.Value
  +                mainLoop eventsResponse.Value
                else                
  -                mainLoop baseUrl events
  +                mainLoop events
       | "2" -> //Connect an event
                printfn "Please provide event name:"
                let eventName = Console.ReadLine()
                let eventStatusResponse = eventStatus baseUrl eventName
                if (eventStatusResponse.IsNone) then
                       printfn "Program failed to exchange data with the event. Eventname, baseURL or connection may be at fault."
  -                    mainLoop baseUrl events
  +                    mainLoop events
                else
                       let (eventName, executed,included,pended) = eventStatusResponse.Value
                       //Write out status:
  
positive.code:     printfn "1 -> Teacher"
      printfn "2 -> Student"
      printf "-> "
      ignore <| match(Console.ReadLine()) with
                | "1" -> role = "Teacher"
                | "2" -> role = "Student"
                | _ ->   printfn "Role doesn't exist!"
                         selectRole n
      true
  
  //Mainloop, covers event selection and exchanging information with the events.    
  let rec mainLoop baseUrl (events : eventStatus list) =
      printfn "Actions:"
      printfn "1 -> Get all events"
      printfn "2 -> Execute an event"
  
negative.code:                         if (response.IsSome) then 
                              response.Value |> printfn "Success! Response: %s" 
                      printfn "action completed"
                      mainLoop events
      | "3" -> baseUrl <- selectBaseUrl 0
               Some(true) //Change BaseURL
      | "4" -> role <- selectRole 0 //Change role
               Some(true)
      | "5" -> //View Status
               printfn "Task:"
               mainLoop (getStatusAndRemovefaulty events baseUrl)
      | "6" -> None //Exit program
      | _   -> None
  
   
  
  //Provides the loop that allows the mainLoop to exit and rerequest the BaseURL.
  let rec outerLoop m = 
      let m = mainLoop []
      if (m.IsSome) then
        outerLoop m
              
  
  //Entry point
  [<EntryPoint>]
  let rec main argv = 
      printfn "Welcome to the testclient of the workflow client"
      Console.Title <- "Workflow test client"
      role <- selectRole 0 //Change role
      //http://localhost:8080/<process>/<session_id>/<event>/<attribute>
      outerLoop None
      0
  